package jianzhiOffer;

public class test04 {
    public static int singleNumber(int[] nums) {
        int s = 0;
        int t=0;
        for(int i=0;i<nums.length;i++){
            s= nums[i];
            for(int j = 0;j<nums.length;j++){
                if(nums[j]==s&&i!=j){
                    break;
                }else{
                    t=j;
                    continue;
                }

            }
            if(t==(nums.length-1))
                return s;
        }
        return 0;
    }

    public static void main(String[] args) {
        int[] a = new int[]{1,1,3,4,4,4,3,5};
        System.out.println(singleNumber(a));
    }
}
